<div class="container">
    <?php
    include 'member-left.php';
    ?>
    <div class="col_r">
        <div class='friend_container'>
            <?php $rsFriend = $member->getAllFriend(40);?>
            <div class="header_link">
                <ul>
                    <li class="actived"><a href="javascript:;">Danh sách bạn bè (<?php echo $db->num_rows($rsFriend);?>)</a></li>
                    <li class="search">
                        <span class="left"></span><input class="inputtext" type="text" id="txtkey_friend" value="Nhập tên một người bạn" title="Nhập tên một người bạn"><span class="right"></span>
                        <div class="reset"></div>
                    </li>
                    <li class="end"></li>
                </ul>
            </div>
            <div id="MySplitter">
                <div class="block_friend" id="friend_drag">

                    <ul class="friend_list">
                        <!--
                        <li >
                            <div class=" add">                        
                                <a href="#">Thêm bạn</a>
                            </div>
                        </li>
                        -->
                        <?php
                        while ($row = $db->fetch_array($rsFriend)) {
                            ?>
                            <li >
                                <div class="friend_box drag" title="<?php echo $row['fullname']; ?>" id="friend_<?php echo $row['id']; ?>" lang="<?php echo $row['id']; ?>" rel="<?php echo $row['groups']; ?>">
                                    <img class="avatar" src="<?php echo $common->get_avatar_thumb($row['avatar']); ?>">
                                    <h4><a href="<?php echo DOMAIN . "/thanh-vien?mid=" . $row['id']; ?>"><?php echo $row['fullname']; ?></a></h4>
                                </div>
                            </li>
                        <?php } ?>
                    </ul>
                    <input type="hidden" class="items_selected" id="number_selected"></input>

                </div>

                <div class="friendgroup_container" >

                    <ul class="friendgroup_list">
                        <li >
                            <div class="circle">
                                <div class="add" >

                                    <div class="content" >
                                        <a href="javascript:void();" onclick="showCreateGroup();">Thêm nhóm </a>

                                    </div>

                                </div>
                            </div>
                        </li>
                        <?php
                        $arrGroup = $member->getAllGroup();
                        while ($row = $db->fetch_array($arrGroup)) {
                            ?>
                            <li >
                                <div class="circle">
                                    <div class="friend_group_box" id="group_<?php echo $row['id']; ?>" lang="<?php echo $row['id']; ?>" title="<?php echo $row['desc']; ?>">
                                        <div class="content" >
                                            <span><b><?php echo $row['group_name']; ?></b></br> (<b class="number"><?php echo $row['length']; ?></b> người)</span>
                                        </div>
                                        <?php
                                        $arrFriendInGroup = $member->getFriendInGroup($row['id'], 14);
                                        while ($rowFriend = $db->fetch_array($arrFriendInGroup)) {
                                            echo '<img id="' . $rowFriend['mid'] . '" lang="'.$rowFriend['mid'].'" class="friend_inner drag" src="' . $common->get_avatar_thumb($rowFriend['avatar']) . '" title="' . $rowFriend['fullname'] . '">';
                                        }
                                        ?>

                                    </div>
                                </div>

                            </li>
                        <?php } ?>

                    </ul>
                </div>
                <div class="splitPane-handle splitPane-handle_h clear" >
                    <div class="splitPane-handle__bar"></div>
                    <div class="splitPane-handle__label">Kéo thả bạn bè vào nhóm bạn bên dưới</div>
                </div>
            </div>
            <div id="createGroup">
                <div  class="title_mb_bg2 create_group">

                    <ul>

                        <li>
                            <div class="col_l">Tên nhóm</div>
                            <div class="col_r"><input type="text" value="" id="i_name" class="inputtext"></div>
                        </li>
                        <li class="end">
                            <div class="col_l">Mô tả thêm</div>
                            <div class="col_r"><textarea id="i_desc" rows="4" class="inputtext"></textarea></div>
                        </li>

                    </ul>
                    <div class="button_bottom">
                        <div class="btn-left-02"><input type="button" onclick="CreateGroup();" id="btncreateGroup" name="btncreateGroup" value="Tạo nhóm" class="btnBlogComment left"></div>
                        <div class="btn-left-07"><input type="button" onclick="Lightbox.hide();" value="Hủy bỏ" class="left button"></div>
                        <img class="loading" style="display:none" src="/images/loading_small.gif">
                        <div class="clear"></div>
                    </div>
                    <div class="clear"></div>
                    <div id="message_alert_content" class="error"></div>
                </div>
            </div>
        </div>


    </div>

   <script src="/js/friends.js" type="text/javascript"></script>
</div>
